import time

from appium import webdriver

desired_caps = dict()
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '5.1'
desired_caps['deviceName'] = '192.168.56.101:5555'
desired_caps['appPackage'] = 'com.android.settings'
desired_caps['appActivity'] = '.Settings'

# 解决中文问题
desired_caps['unicodeKeyboard'] = True
desired_caps['resetKeyboard'] = True

driver = webdriver.Remote('http://192.168.41.103:4723/wd/hub', desired_caps)

time.sleep(3)

# driver.swipe(100, 1000, 100, 500, 5000)


# save_button = driver.find_element_by_xpath("//*[@text='存储']")
# more_button = driver.find_element_by_xpath("//*[@text='更多']")
#
# driver.scroll(save_button, more_button, 5000)


save_button = driver.find_element_by_xpath("//*[@text='存储']")
more_button = driver.find_element_by_xpath("//*[@text='更多']")
driver.drag_and_drop(save_button, more_button)

